(function($){
    function formResult(msg, state) {
        layer.closeAll();
        if(state == 0) {
            layer.alert(msg, {icon: 5});
        }else{
            location.reload(true);
        }
    }
    function init(){
        $(".add").click(function(index){
            parent.layer.open({
                type: 2,
                area: ['620px', '340px'],
                title:$(this).attr('dtitle'),
                fix: true, //不固定
                maxmin: true,
                content: $(this).attr('durl')
            });
        })
    }

    $(function() {
        layer.config({
            extend: 'extend/layer.ext.js'
        });
        window.formResult = formResult;
        init();

    })
})(jQuery);